<?php

/* create a new user based on post request */
/* and redirect to original page */

/* should check for current users session*/
/* should check for existing email in database */

session_start();

include("inc/dbConnection.php");
include("class/session.class.php");

$db = new Dbo(); // call mysql_connect to use sanitizing function

$name = mysql_real_escape_string($_POST["name"]);
$session_start = mysql_real_escape_string($_POST["session_start"]);
$description = mysql_real_escape_string($_POST["description"]);
$duration = mysql_real_escape_string($_POST["duration"]);
$max_student = mysql_real_escape_string($_POST["max_student"]);

$tutor = $_SESSION["account"];

session::getInstance()->new_session($name, $session_start, $duration, $max_student, $description, $tutor);

header("Location: " . $_SERVER['HTTP_REFERER']);

?>